Deadlock-Free Channels and Locks
نویسندگان
چکیده
The combination of message passing and locking to protect shared state is a useful concurrency pattern. However, programs that employ this pattern are susceptible to deadlock. That is, the execution may reach a state where each thread in a set waits for another thread in that set to release a lock or send a message. This paper proposes a modular verification technique that prevents deadlocks in programs that use both message passing and locking. The approach prevents deadlocks by enforcing two rules: (0) a blocking receive is allowed only if another thread holds an obligation to send and (1) each thread must perform acquire and receive operations in accordance with a global order. The approach is proven sound and has been implemented in the Chalice program verifier.
منابع مشابه
VeriSHIM A BDD Verifier for SHIM
Concurrent programming languages have become more popular with the advent of multi-core systems. Shared memory is read or written atomically, by concurrent processes to prevent races. A typical mechanism is the use of locks. However, if locks are not acquired and released in the correct order, the result is a deadlock. In this paper, we propose a deadlock detection tool for a deterministic, con...
متن کاملDeadlock checking by a behavioral effect system for lock handling
Deadlocks are a common error in programs with lock-based concurrency and are hard to avoid or even to detect. One way for deadlock prevention is to deadlocks. Often static approaches try to confirm that the lock-taking statically analyze the program code to spot sources of potential adheres to a given order, or, better, to infer that such an order exists. Such an order precludes situations of c...
متن کاملKa I Pun , Martin Steffen , and Volker Stolz I SBN 82 - 7368 - 366
Deadlocks are a common error in programs with lock-based concurrency and are hard to avoid or even to detect. One way for deadlock prevention is to statically analyze the program code to spot sources of potential deadlocks. Often static approaches try to confirm that the lock-taking adheres to a given order, or, better, to infer that such an order exists. Such an order precludes situations of c...
متن کاملDeadlock-Free Monitors: Extended Version
Monitors constitute one of the common techniques to synchronize threads in multithreaded programs, where calling a wait command on a condition variable suspends the caller thread and notifying a condition variable causes the threads waiting for that condition variable to resume their execution. One potential problem with these programs is that a waiting thread might be suspended forever leading...
متن کاملTransactional Memory Should Be an Implementation Technique, Not a Programming Interface
© Transactional Memory Should Be an Implementation Technique, Not a Programming Interface Hans-J. Boehm HP Laboratories HPL-2009-45 transactional memory, locks Transactional memory is often advocated as an easier-to-use replacement or locks that avoids any possibility of deadlock. Recently, as more care has been exercised in precisely specifying its semantics, a number of researchers have obser...
متن کاملRelaxed Synchronization with Ordered Read-Write Locks
This paper promotes the first stand-alone implementation of our adaptive tool for synchronization ordered read-write locks, ORWL. It provides new synchronization methods for resource oriented parallel or distributed algorithms for which it allows an implicit deadlock-free and equitable control of a protected resource and provides means to couple lock objects and data tightly. A typical applicat...
متن کامل